Xbasic methods for the HTML and HTMLHOST Xdialog Commands
.NavigateFirst as l() .NavigateLast as l() .NavigateNext as l() .NavigatePrev as l() .GetElemRect as c(id as c) .GetAttribute as c(id as c,attrib as c) .SetAttribute as v(id as c,attrib as c,value as c) .GetValue as c(id as c) .SetValue as v(id as c,value as c) .SetInnerHtml as v(id as c,html as c) .SetOuterHtml as v(id as c,html as c) .GetInnerHtml as c(id as c) .GetOuterHtml as c(id as c) .GetFocus as c() .SetFocus as l(id as c) .GetChecked as l(id as c) .SetChecked as v(id as c,checked as l) .MakeVisible as l(id as c) .Invalidate as v(id as c) .GetIdFromPoint as c(x as n,y as n) .EditCopy as v() .EditPaste as v() .EditDelete as v() .EditSelect as v(start_char as n = 0,end_char as n = -1) .EditSupportsMultiLine as l() .GetRememberedAttributes as c() .SetRememberedAttributes as v(rememberList as c)
Description
This article describes the new Xbasic methods that can be used on the HTML that is rendered by either the {html} or new {htmlhost} commands.
This is how we documented that you use the {html} command
dim htmlTextVariable as c htmlTextVariable = <<%html% <b>Hello World</b> %html% ui_dlg_box("HTML",<<%dlg% {html=100,20htmlTextVariable}; %dlg%)
However, if you want to use methods, you must use this syntax (differences highlighted in red):
dim htmlTextVariable as c htmlTextVariable = <<%html% <b>Hello World</b> %html% dim pHTML as p dim pHTML.object as p dim pHTML.text as c = htmlTextVariable ui_dlg_box("HTML",<<%dlg% {html=100,20pHhtml}; %dlg%)
<HTMLObject>.NavigateFirst as l()
Navigate to first element (return true if succeeded).
<HTMLObject>.NavigateLast as l()
Navigate to last element (return true if succeeded).
<HTMLObject>.NavigateNext as l()
Navigate to the next element in the html (return true if succeeded).
<HTMLObject>.NavigatePrev as l()
Navigate to the previous element in the html (return true if succeeded).
<HTMLObject>.GetElemRect as c(id as c)
Returns rectangle for id.
<HTMLObject>.GetAttribute as c(id as c,attrib as c)
Get an attribute value from a element.
<HTMLObject>.SetAttribute as v(id as c,attrib as c,value as c)
Set an attribute value for a element.
<HTMLObject>.GetValue as c(id as c)
Returns value from a control.
<HTMLObject>.SetValue as v(id as c,value as c)
Sets value to a control.
<HTMLObject>.SetInnerHtml as v(id as c,html as c)
Sets inner HTML for control.
<HTMLObject>.SetOuterHtml as v(id as c,html as c)
Sets outer HTML for control.
<HTMLObject>.GetInnerHtml as c(id as c)
Sets inner HTML for control.
<HTMLObject>.GetOuterHtml as c(id as c)
Sets outer HTML for control.
<HTMLObject>.GetFocus as c()
Return the id of the element that has focus.
<HTMLObject>.SetFocus as l(id as c)
Sets focus to object of given id.
<HTMLObject>.GetChecked as l(id as c)
Get the elements checked state.
<HTMLObject>.SetChecked as v(id as c,checked as l)
Set the element as checked.
<HTMLObject>.MakeVisible as l(id as c)
Make control with id visible.
<HTMLObject>.Invalidate as v(id as c)
Repaint a control.
<HTMLObject>.GetIdFromPoint as c(x as n,y as n)
Gets first object with an Id, returns the id.
<HTMLObject>.EditCopy as v()
Copy to the clipboard.
<HTMLObject>.EditPaste as v()
Paste from the clipboard.
<HTMLObject>.EditDelete as v()
Delete the text.
<HTMLObject>.EditSelect as v(start_char as n = 0,end_char as n = -1)
Select text in the current editor.
<HTMLObject>.EditSupportsMultiLine as l()
Does editor support multi-line (i.e. send returns & paging to control).
<HTMLObject>.GetRememberedAttributes as c()
Returns cl-lf delimited list of remembered attributes & their values.
<HTMLObject>.SetRememberedAttributes as v(rememberList as c)
Pass in an previously saved list of attributes that we want to restore.
See Also